/* eslint-disable react/prop-types */
/* eslint-disable no-unused-vars */
import React, { Component } from 'react'

export default class Comc extends Component {
  state = {
    x: 0, y: 0
  }

  move = (e) => {
    console.log('move')
    this.setState({
      x: e.pageX,
      y: e.pageY
    })
  }

  componentDidMount () {
    document.addEventListener('mousemove', this.move)
  }

  componentWillUnmount () {
    document.removeEventListener('mousemove', this.move)
  }

  render () {
    return this.props.render(this.state)
  }
}
